<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" href="../css/reset.css">
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" href="../css/integral_richScan.css">
    <title>会员签到</title>
    <style>
        .aui-bar-light {
            border-bottom: 0;
        }
        
        .textCenter {
            text-align: center;
        }
        
        .imgLogo {
            margin: 0 auto;
            width: 10.15rem;
            padding: 2.5rem 0 1rem;
        }
        
        .imgBorder {
            margin: 0 auto;
            width: 9.5rem;
            background-image: url('../images/bg-border.png');
            height: 15rem;
            background-size: cover;
            position: relative;
        }
        
        #code {
            position: absolute;
            bottom: 0.9rem;
            left: 0.9rem;
            width: 7.7rem;
            height: 7.7rem;
        }
        
        #code canvas {
            margin: 0 auto;
            width: 7.7rem;
            height: 7.7rem;
        }
    </style>

</head>

<body style=" background: #ffffff;">

    <header class="aui-bar aui-bar-nav aui-bar-light" style="background: #4e536c;">
        <a class="aui-pull-left aui-btn" onclick="back()">
            <span class="aui-iconfont aui-icon-left" style="color: #FFFFFF;"></span>
        </a>
        <div class="aui-title" style="color: #FFFFFF;">会员签到</div>

    </header>
    <div class="content">
        <div class="imgLogo">
            <img src="../images/send.png" alt="送积分">
        </div>
        <div class="border">
            <div class="imgBorder">
                <div id="code"></div>
            </div>
        </div>



    </div>

    <script src="../js/comment.js"></script>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/jquery.qrcode.min.js"></script>
    <script>
        $(function() {
            var obj = JSON.parse(window.localStorage.getItem('obj'));
            qrCode();

            function qrCode() {
                $.ajax({
                    type: "post",
                    url: url + "integralrule/setTimeToRedis",
                    data: {
                        id: obj.storeId
                    },
                    success: function(res) {
                        var res = JSON.parse(res);
                        console.log(res)
                        if (res.code == 200) {
                            var date = res.datas.timeMills;
                            var qrTxt = url + "code?storeId=" + obj.storeId + "&times=" + date;
                            $("#code").html("").qrcode({
                                render: "canvas",
                                text: qrTxt,
                            });
                        }
                    }
                })
            }

            setInterval(function() {
                qrCode();
            }, 300000)
        })
    </script>
</body>

</html>